<div class="wikiPage">
    <div class="title nav">
        <?php echo CHtml::link(CHtml::encode($data->title), $data->url,array('title'=>Yii::t('site','View Wiki Page {title}',array('{title}'=>$data->title)))); ?>
    </div>
    <div class="author">
        <?php //echo CHtml::encode(Yii::t('site','posted by {username} on {date}',array('{username}'=>$data->author->getFullName(getClassConst('User','NAMETYPE_LAST_C_FIRST1')),'{date}'=>Yii::app()->dateFormatter->formatDateTime($data->create_time,'medium','short')))); ?>
    </div>
    <?php if(!isset($show_content) and trim($data->content)!=='') : ?>
    <p>
        <?php echo '&nbsp;&nbsp;&rArr;&nbsp;'.CHtml::link(Yii::t('site','Read more...'),array('/wikiPage/view','id'=>$data->id,'WikiPage[show_content]'=>1)); ?>
    </p>
    <?php else : ?>
    <div class="content">
        <?php
            $this->beginWidget('CMarkdown', array('purifyOutput'=>true));
            echo $data->content;
            $this->endWidget();
        ?>
    </div>
    <?php endif; ?>
    <div class="nav">
        <table style="margin:0">
            <tr>
                <td>
                    <?php if($data->wikiBookId!=0) : ?>
                    <b><?php echo CHtml::encode(Yii::t('site','Book:')); ?></b>
                    <?php echo CHtml::link($data->wikiBook->name,array('/wikiBook/view','id'=>$data->wikiBookId)); ?>
                    <?php endif; ?>
                    
                    <?php  $tagLinks = $data->getTagLinks(false); if(count($tagLinks)>0) : ?>
                    <b><?php echo CHtml::encode(Yii::t('site','Tags:')); ?></b>
                    <?php echo implode(', ', $data->getTagLinks(false)); ?>
                    <?php endif; ?>
                    <br/>

                    <?php echo Yii::app()->user->checkAccess('admin') ? CHtml::link(ICON_EDIT,array('/wikiPage/update','id'=>$data->id)) : ''; ?>
                    <?php echo CHtml::link('Permalink', $data->url); ?>
                    <?php //echo CHtml::encode(Yii::t('site','Last updated on {date}',array('{date}'=>Yii::app()->dateFormatter->formatDateTime($data->update_time,'medium','short')))); ?>
                </td>
                <td>
                    <?php $this->widget('TimestampWidget',array('title'=>Yii::t('site','Change Log'),'model'=>$data,'style'=>'small')); ?>
                </td>
            </tr>
        </table>
    </div>
</div>
